
#pragma once

#include <AVUIControl.h>

namespace AVUI {

class RangeBase : public Control
{
public:
    RangeBase() { };
    ~RangeBase() { };

    DECLARE_ELEMENT(RangeBase, Control);

    DECLARE_DEPENDENCY_PROPERTY(Minimum);
    float get_Minimum() { return AVUI::UnboxValue<float>(GetValue(get_MinimumProperty())); }
    void set_Minimum(float value) { SetValue(get_MinimumProperty(), AVUI::BoxValue(value)); } 

    DECLARE_DEPENDENCY_PROPERTY(Maximum);
    float get_Maximum() { return AVUI::UnboxValue<float>(GetValue(get_MaximumProperty())); }
    void set_Maximum(float value) { SetValue(get_MaximumProperty(), AVUI::BoxValue(value)); } 

    DECLARE_DEPENDENCY_PROPERTY(Value);
    float get_Value() { return AVUI::UnboxValue<float>(GetValue(get_ValueProperty())); }
    void set_Value(float value) { SetValue(get_ValueProperty(), AVUI::BoxValue(value)); } 

    DECLARE_DEPENDENCY_PROPERTY(LargeChange);
    float get_LargeChange() { return AVUI::UnboxValue<float>(GetValue(get_LargeChangeProperty())); }
    void set_LargeChange(float value) { SetValue(get_LargeChangeProperty(), AVUI::BoxValue(value)); } 

    DECLARE_DEPENDENCY_PROPERTY(SmallChange);
    float get_SmallChange() { return AVUI::UnboxValue<float>(GetValue(get_SmallChangeProperty())); }
    void set_SmallChange(float value) { SetValue(get_SmallChangeProperty(), AVUI::BoxValue(value)); } 

protected:

    virtual void OnMinimumChanged() { }
    virtual void OnMaximumChanged() { }
    virtual void OnValueChanged() { }

private:
    static void StaticConstructor();

    static void OnMinimumChanged(DependencyObject* pDO, DependencyPropertyChangedEventArgs* e) { ((RangeBase*) pDO)->OnMinimumChanged(); }
    static void OnMaximumChanged(DependencyObject* pDO, DependencyPropertyChangedEventArgs* e) { ((RangeBase*) pDO)->OnMaximumChanged(); }
    static void OnValueChanged(DependencyObject* pDO, DependencyPropertyChangedEventArgs* e) { ((RangeBase*) pDO)->OnValueChanged(); }


};


}; // namespace AVUI
